package com.linkoog.devtools.json.toolwindow.ui.jsontree;

import com.intellij.ui.ColoredTreeCellRenderer;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class TreeKeyCellRenderer extends ColoredTreeCellRenderer {


    @Override
    public void customizeCellRenderer(@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
        if (value instanceof JsonTreeNode){
            JsonTreeNode node = (JsonTreeNode)value;
            this.append(node.getName(), TreeStyles.keyValueAttribute);
        }
    }

}
